home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / pcboard / pcbim20.zip / PCBIM20.RAR / PCBRUN.BAT < prev    next >
DOS Batch File  |  1996-06-08  |  14KB  |  442 lines

  1. @echo off
  2. :: ################################################################
  3. :: ##   PCBoard/InterMail/OS2/DOS Intelligent Batch File V2.0    ##
  4. :: ##      Written by Darrell Harder - Game Quest BBS SysOp      ##
  5. :: ##  gremlin@express.ca - FidoNet 1:153/9117 - [604]535-1077   ##
  6. :: ################################################################
  7. ::
  8. :: -===[ Command Format ]==========================================-
  9. ::   PCBRUN        (for node 1 operation)
  10. ::   PCBRUN [node] (for node XX operation)
  11. ::   [node] is the node number from 1 through to 99
  12. ::   eg  PCBRUN 3
  13.  
  14. :: -===[ NOTES! ]=================================================-
  15. :: If no arguments passed to PCBRUN.BAT then force TASK to 1
  16. if %1! == !     SET TASK=1
  17. if %1  == 0     goto MEGAERROR
  18. if not %1! == ! SET TASK=%1
  19.  
  20. :: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  21. :: %%                Global Environment Variables                %%
  22. :: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  23.  
  24. :: -===[ InterMail ]===============================================-
  25. :: Change as required to your InterMail Drive and Directory
  26. Set IMVER=229i
  27. Set IMDRV=C:
  28. Set IM=C:\IM
  29.  
  30. :: -===[ BG Fax ]=================================================-
  31. :: Change as required to your BG Fax Drive and Directory
  32. Set BGFAX=C:\IM\BGFAX
  33.  
  34. :: -===[ PCBoard ]================================================-
  35. :: Change as required to your PCBoard Drive and Directory
  36. Set PCBVER=15.22
  37. Set PCBDRIVE=C:
  38. Set PCBDIR=\PCB\NODE%TASK%
  39.  
  40. :: -===[ DSZ ]====================================================-
  41. Set CEXYZLOG=%PCBDRIVE%%PCBDIR%\CEXYZ.%TASK%
  42. Set DSZLOG=%PCBDRIVE%%PCBDIR%\PCBDSZ.%TASK%
  43.  
  44. :: -===[ NOTES! ]=================================================-
  45. :: If you have your PCB com ports on different nodes than the ones
  46. :: used here, be sure to make changes!
  47. ::
  48. :: If you don't have a local node and want to change them to actual
  49. :: PCBoard Nodes then the following changes WILL BE REQUIRED
  50. ::
  51. :: Warning! ─> DO NOT CHANGE TASK "0"!
  52. if %TASK% == 0 goto localbbs
  53. :: Check label (localbbs) to see if changes are required
  54. :: Add Rem (::) to change from local BBS to Sysem Node
  55. if %TASK% == 1 goto localbbs
  56. :: Add and/or Change Ports as required per your BBS settings.
  57. :: [NODE]  [NODE]     [PORT]
  58. :: Remove Rem (::) to change from local BBS to System Node
  59. if %TASK% == 1 Set PORT=1
  60. if %TASK% == 2 Set PORT=2
  61. if %TASK% == 3 Set PORT=4
  62. if %TASK% == 4 Set PORT=5
  63. if %TASK% == 5 Set PORT=6
  64. if %TASK% == 6 Set PORT=3
  65. if %TASK% == 7 Set PORT=7
  66. if %TASK% == 8 Set PORT=8
  67.  
  68. :: -===[ SIO & SU ]===============================================-
  69. :: Change as required to your SU.EXE Drive and Directory
  70. Set SU=C:\U2\SIO
  71.  
  72. :: -===[ NOTES! ]=================================================-
  73. :: Remove Rem (::) to lock certain nodes at a lower speed.
  74. :: (Great for calling overseas so you don't lose carrier)
  75. :: Change LOCKBAUD=xxxxx as required for global locked baud rates.
  76. Set LOCKBAUD=57600
  77. :: [NODE] [NODE] [SIO Util] [PORT] [Locked BAUD Rates]
  78. if %TASK% == 1  %SU%\SU.EXE %PORT% LOCK %LOCKBAUD%
  79. if %TASK% == 2  %SU%\SU.EXE %PORT% LOCK %LOCKBAUD%
  80. if %TASK% == 3  %SU%\SU.EXE %PORT% LOCK %LOCKBAUD%
  81. if %TASK% == 4  %SU%\SU.EXE %PORT% LOCK %LOCKBAUD%
  82. :: if %TASK% == 4  %SU%\SU.EXE %PORT% LOCK 19200
  83. if %TASK% == 5  %SU%\SU.EXE %PORT% LOCK %LOCKBAUD%
  84. if %TASK% == 6  %SU%\SU.EXE %PORT% LOCK %LOCKBAUD%
  85. if %TASK% == 7  %SU%\SU.EXE %PORT% LOCK %LOCKBAUD%
  86. if %TASK% == 8  %SU%\SU.EXE %PORT% LOCK %LOCKBAUD%
  87.  
  88.  
  89. :: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  90. :: %%                    InterMail Start Up                      %%
  91. :: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  92.  
  93. :: -===[ Display to SysOp for information ]=======================-
  94. echo.
  95. echo.
  96. echo  [≡≡≡]╠:::::::::: Starting PC Board v%PCBVER% & InterMail v%IMVER%
  97. echo                         On  Node: %TASK%  Port: %PORT%
  98. echo.
  99. echo.
  100. wait! 1 s
  101.  
  102. :: -===[ InterMail Looping Label ]================================-
  103. :startim
  104. %IMDRV%
  105. cd %IM%
  106. IM /#%TASK% /nf /os2to:4 /rdbg
  107.  
  108. :: -===[ Checking InterMail exit codes ]==========================-
  109. :: These you will have to define in the InterMail Setup program
  110. if errorlevel 255  goto fax_in
  111. if errorlevel 212  goto 38400
  112. if errorlevel 211  goto 33600
  113. if errorlevel 210  goto 31200
  114. if errorlevel 209  goto 28800
  115. if errorlevel 208  goto 26400
  116. if errorlevel 207  goto 24000
  117. if errorlevel 206  goto 21600
  118. if errorlevel 205  goto 19200
  119. if errorlevel 204  goto 16800
  120. if errorlevel 203  goto 14400
  121. if errorlevel 202  goto 12000
  122. if errorlevel 201  goto 9600
  123. if errorlevel 200  goto 7200
  124. if errorlevel 199  goto 4800
  125. if errorlevel 198  goto 2400
  126. if errorlevel 197  goto 1275
  127. if errorlevel 196  goto 1200
  128. if errorlevel 195  goto 300
  129. :: if errorlevel 191 goto scanecho
  130. :: if errorlevel 190 goto unpackmail
  131. if errorlevel 100  goto mail_in
  132. if errorlevel  50  goto localbbs
  133. if errorlevel  49  goto wait_till
  134. if errorlevel  34  goto weeklyevent
  135. if errorlevel  33  goto dailyevent
  136. if errorlevel  25  goto startim
  137. if errorlevel  10  goto finish
  138. if errorlevel   8  goto internal
  139. if errorlevel   6  goto fossil
  140. if errorlevel   5  goto modeminit
  141. if errorlevel   4  goto modemresp
  142. if errorlevel   3  goto fulldisk
  143. if errorlevel   2  goto external
  144. if errorlevel   1  goto internal
  145. goto startim
  146.  
  147. :: -===[ Connect Speed Labels ]===================================-
  148. :: Used to pass the connect speeds to PCBoard
  149. :38400
  150. Set CON=38400
  151. goto caller
  152. :33600
  153. Set CON=33600
  154. goto caller
  155. :31200
  156. Set CON=31200
  157. goto caller
  158. :28800
  159. Set CON=28800
  160. goto caller
  161. :26400
  162. Set CON=26400
  163. goto caller
  164. :24000
  165. Set CON=24000
  166. goto caller
  167. :21600
  168. Set CON=21600
  169. goto caller
  170. :19200
  171. Set CON=19200
  172. goto caller
  173. :16800
  174. Set CON=16800
  175. goto caller
  176. :14400
  177. Set CON=14400
  178. goto caller
  179. :12000
  180. Set CON=12000
  181. goto caller
  182. :9600
  183. Set CON=9600
  184. goto caller
  185. :7200
  186. Set CON=7200
  187. goto caller
  188. :4800
  189. Set CON=4800
  190. goto caller
  191. :2400
  192. Set CON=2400
  193. goto caller
  194. :1275
  195. Set CON=1275
  196. goto caller
  197. :1200
  198. Set CON=1200
  199. goto caller
  200. :300
  201. Set CON=300
  202. goto caller
  203.  
  204. :: -===[ BGFax Label for Faxs ]===================================-
  205. :fax_in
  206. cd %BGFAX%
  207. CALL bg_fax.bat
  208. goto startim
  209.  
  210. :: -===[ BBS Caller Label ]========================================-
  211. :caller
  212. Set PCBDAT=C:\PCB\PCBOARD.DAT
  213. Set NODE=%TASK%
  214. Set PCB=/C:%CON% /PORT%PORT%: /OS /NODE:%TASK% /NOFIDO /BAUD:%LOCKBAUD%
  215.  
  216. :: This is a bit tricky. You can run this batch file with no DOBBS.BAT
  217. :: and without a EXECBBS.BAT, however, you must be aware that there are
  218. :: is something that you will not get, and that is the correct connect
  219. :: information. All of this is not required for 99% of most BBS. But on
  220. :: mine it is because I run a DOOM server and I need to know exactly
  221. :: what the carrier information is. If you wish to try this without
  222. :: that info and use PCBRUN.BAT as a single, yes, single batch to run
  223. :: all of your nodes, then just Rem (::) out the next line and try it.
  224. :: Like I said, if I did not need the other information passed to PCB
  225. :: I would be using PCBRUN.BAT as the only batch file. <G> Enjoy!
  226. :: You can pass some info via the connecting information (/Arq/None)
  227. :: but that involves changing a few other things and I will not get into
  228. :: it unless some one sends me a message about wanting it that way.
  229.  
  230. :: -===[ Rem (::) this line to run as a single intelligent batch. ]======-
  231. DOBBS.BAT
  232.  
  233. :: -===[ NOTES! ]========================================================-
  234. :: Echo Information to screen for Sysop to make sure settings are correct
  235. echo Connect %1
  236. echo Port: %2
  237. echo Minutes  %3
  238. echo Modem connection %4
  239. echo Node: %5
  240. wait! 1 s
  241.  
  242. :: -===[ Connect Carrier String ]========================================-
  243. :: Used to pass the connect carrier speed and string to PCBoard
  244. SET CONNECT=/CSTR:%4 %PCB%
  245. SET PCB=%CONNECT%
  246.  
  247. :: -===[ NOTES! ]========================================================-
  248. :: Clean up used Environment Variables to save Environment space
  249. SET CON=
  250. SET CONNECT=
  251.  
  252. :: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  253. :: %%                  PCBoard  Starting Loop                    %%
  254. :: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  255. :startpcb
  256. %PCBDRIVE%
  257. cd %PCBDIR%
  258. if exist remote.bat REN remote.bat remote.sys
  259. if exist event.bat  DEL event.bat
  260. if exist door.bat   DEL door.bat
  261. if exist endpcb     DEL endpcb
  262. pcboardm %PCB%
  263. :: %ERROR /cstr:%CSTRING% /EVENT:%EVENTIME%
  264. if exist remote.bat CALL remote.bat
  265. if exist door.bat   CALL door.bat
  266. if exist event.bat  CALL event.bat
  267. if exist endpcb     GOTO after_pcb
  268. if NOT exist endpcb GOTO startpcb
  269. goto after_pcb
  270.  
  271. :: -===[ After PCBoard Caller Label ]=============================-
  272. :after_pcb
  273.  
  274. :: Clean up Node Directory
  275. if exist %PCBDIR%\*.BAK       echo Y | del %PCBDIR%\*.BAK
  276. if exist %PCBDIR%\*.LOG       echo Y | del %PCBDIR%\*.LOG
  277. if exist %PCBDIR%\*.TMP       echo Y | del %PCBDIR%\*.TMP
  278. if exist %PCBDIR%\*.TXT       echo Y | del %PCBDIR%\*.TXT
  279. if exist %PCBDIR%\WORK\*.*    echo Y | del %PCBDIR%\WORK\*.*
  280. if exist %PCBDIR%\*.%PCBNODE% echo Y | del %PCBDIR%\*.%PCBNODE%
  281.  
  282. :: -===[ Other things you need to do when the user logs off. ]====-
  283. :: intrecho /scan
  284.  
  285. if errorlevel 99 goto setuperror
  286. if errorlevel 10 goto startpcb
  287. if errorlevel  8 goto startpcb
  288. if errorlevel  4 goto modeminit
  289. goto startim
  290.  
  291. :: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  292. :: %%      InterMail Maintenance Labels for Exit Levels          %%
  293. :: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  294.  
  295. :: -===[ Local Logon Label for Sysop ]============================-
  296. :localbbs
  297. %PCBDRIVE%
  298. cd %PCBDIR%
  299. pcboardm /localon
  300. goto after_pcb
  301.  
  302. :: -===[ Mail Call label ]========================================-
  303. :mail_in
  304. %IMDRV%
  305. cd %IM%
  306. echo ath1 > com%PORT%
  307. echo InterEcho Processing Inbound Mail
  308. :: intrecho
  309. :: CALL c:\im\compile.bat
  310. goto startim
  311.  
  312. :: -===[ Weekly Events Label ]====================================-
  313. :weeklyevent
  314. %IMDRV%
  315. cd %IM%
  316. :: intrecho /notify
  317. goto startim
  318.  
  319. :: -===[ Daily Events Label ]=====================================-
  320. :dailyevent
  321. %IMDRV%
  322. cd %IM%
  323. cls
  324. echo.
  325. echo.
  326. echo Daily Maintenance Being performed
  327. :: Put all you dailt maint here. I use CALL to my batches a lot
  328. :: because I can track problems down quicker
  329. :: CALL e:\fdfiles\ezy-mail.bat
  330. :: CALL c:\im\compile.bat
  331. :: CALL c:\bbs\mailin.bat
  332. :: CALL c:\allfix\all_fix.bat
  333.  
  334. %PCBDRIVE%
  335. cd %PCBDIR%
  336. :: ------ PCboard daily message maint -----------------------------------
  337. pcbpack /area:0;1;2-31 /cap:c:\pcb\L-PACK.RPT /days:90 /killbak /killdups /crc:50 /maxmsgs:200 /report:c:\pcb\L-BUL.RPT
  338. pcbpack /area:100-200 /fast /cap:c:\pcb\F-PACK.RPT /days:60 /killbak /killdups /crc:50 /maxmsgs:400 /report:c:\pcb\F-BUL.RPT
  339. intrecho
  340. pcbpack /area:all /index
  341.  
  342. :: =====[ These are nothing more than examples and tests ]=========-
  343. :: ----- Batch file to save BRE Game.dat file ---------------------------
  344. :: CALL c:\bbs\ezybats\brechek.bat
  345. :: CALL bresave.bat
  346. :: pcbpack /area:0-31 /cap:c:\pcb\BULS.RPT /days:90 /killbak /killdups /crc:50 /maxmsgs:200 /report:c:\pcb\PCBPACK.RPT
  347. :: fidopcb toss
  348. :: pcbnet /area:all
  349. :: pcbpack /area:all /report:buls\blt13 /upcase
  350. :: pcbfiler /sort
  351. :: :pack
  352. :: pcbpack /area:0-1 /days:60 /maxmsgs:500
  353. :: pcbpack /area:7 /days:12 /killbak /maxmsgs:20
  354. :: pcbpack /area:30-34 /cap:i:\logs\pack.log /crc:50 /killbak /killdups /maxmsgs:600
  355. :: pcbpack /area:35-36 /cap:i:\logs\pack.log /crc:50 /killbak /killdups /maxmsgs:400
  356. :: pcbpack /area:37 /killbak /maxmsgs:200
  357. :: pcbpack /area:38-59 /maxmsgs:500 /killbak /killdups /crc:50
  358. :: pcbpack /area:60 /killbak /maxmsgs:200
  359. :: pcbpack /area:100-129 /killbak /maxmsgs:500
  360.  
  361. wait! 1 m
  362. goto startim
  363.  
  364. :: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  365. :: %%  InterMail Labels for Internal/External Error Exit Levels  %%
  366. :: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  367.  
  368. :: -===[ Set Up Error Label ]=====================================-
  369. :setuperror
  370. echo Setup Error!
  371. goto startim
  372.  
  373. :: -===[ Run Time Error Label ]===================================-
  374. :runtimeerror
  375. echo Runtime Error! Consult Errors.Log
  376. goto startim
  377.  
  378. :: -===[ Fossil Error Label ]=====================================-
  379. :fossil
  380. Echo Wrong Fossil Version!
  381. goto finish
  382.  
  383. :: -===[ this is tricky ]=========================================-
  384. :wait_till
  385. echo ath1 > com%PORT%
  386. wait! 5 s
  387. goto startim
  388.  
  389. :: -===[ Modem Init Error Label ]=================================-
  390. :modeminit
  391. cls
  392. Echo.
  393. Echo         InterMail Unable To Initialize Modem!
  394. Echo.
  395. Echo Now trying to re-init Pcboard/InterMail Node %TASK%
  396. wait! 2 s
  397. echo ATHZ > com%PORT%
  398. wait! 2 s
  399. echo ATH1 > com%PORT%
  400. goto startim
  401.  
  402. :: -===[ Modem Not Responding Error ]=============================-
  403. :modemresp
  404. Echo InterMail Modem NOT Responding!
  405. goto finish
  406.  
  407. :: -===[ Disk Full Error Label ]==================================-
  408. :fulldisk
  409. Echo Insufficent Disk Space To Proceed!
  410. goto finish
  411.  
  412. :: -===[ External File Error Label ]==============================-
  413. :external
  414. Echo External InterMail Error - System File Missing!
  415. goto finish
  416.  
  417. :: -===[ Internal File Error Label ]=============================-
  418. :internal
  419. Echo Internal InterMail Error!
  420. goto finish
  421.  
  422. :: -===[ We are finished ]========================================-
  423. :finish
  424. echo.
  425. echo               Terminating PC Board/InterMail v%IMVER% on Node: %TASK% Port: %PORT%
  426. echo.
  427. :: -===[ NOTE! ]==================================================-
  428. :: This statment needed because I have MOUSE on COM1
  429. if %TASK% == 1 goto end
  430. echo ath1 > com%PORT%
  431. echo.
  432. echo.
  433. goto end
  434.  
  435. :: -===[ NOTE! ]==================================================-
  436. :megaerror
  437.  
  438. :: -===[ Back to InterMail Directory ]============================-
  439. :end
  440. %IMDRV%
  441. CD %IM%
  442.